package com.mcp_life.common.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 阿里云API凭证管理类
 */
@Data
@Component
public class AliyunApiCredentialManager {
    
    /**
     * AppKey (用于签名)
     */
    @Value("${aliyun.api.appkey:}")
    private String appKey;
    
    /**
     * AppSecret (用于签名)
     */
    @Value("${aliyun.api.appsecret:}")
    private String appSecret;
    
    /**
     * AppCode (用于认证)
     */
    @Value("${aliyun.api.appcode:}")
    private String appCode;
    
    /**
     * 获取AppKey
     * @return AppKey
     */
    public String getAppKey() {
        return appKey;
    }
    
    /**
     * 获取AppSecret
     * @return AppSecret
     */
    public String getAppSecret() {
        return appSecret;
    }
    
    /**
     * 获取AppCode
     * @return AppCode
     */
    public String getAppCode() {
        return appCode;
    }
    
    /**
     * 检查凭证是否配置完整
     * @return 是否配置完整
     */
    public boolean isConfigured() {
        return appKey != null && !appKey.isEmpty() &&
               appSecret != null && !appSecret.isEmpty() &&
               appCode != null && !appCode.isEmpty();
    }
}
